package Action;

import PO.CutOffDatePage;
import PO.DuoShangPage;
import com.epwk.action.Action;
import com.epwk.action.JSExecutor;
import com.epwk.action.MouseAction;
import com.epwk.driver.SeleniumDriver;
import com.epwk.tools.DateFormat;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import java.util.List;
import Action.*;

import static com.epwk.driver.SeleniumDriver.driver;

/**
 * Created by Administrator on 2016/11/24.
 */
public class DuoShang {

    public static void duoShang(int cash,int winNum,int[] cashs,int pnum,int day)  {

        Action.click(DuoShangPage.model_xs);
        Action.sendkeys(DuoShangPage.cash_xs,String.valueOf(cash));
        Action.click(DuoShangPage.duoshang);

//        中标人数
//        int winNum = 5;
//        double[] cashs = {400,300,100,60,40};
        MouseAction.selectValue(DuoShangPage.winNum,winNum-2);

        List<WebElement> eles = driver.findElements(DuoShangPage.cash_n);
        for (int i = 0; i < eles.size(); i++) {
            eles.get(i).sendKeys(String.valueOf(cashs[i]));
        }

//      入围人数
//        SelectedNum.selectedNum(pnum);

//        设置截止时间
//        CutOffDate.cutOffDate(day,type);

        Action.clear(CutOffDatePage.CutOffDate_xs);
        Action.sendkeys(CutOffDatePage.CutOffDate_xs,DateFormat.beforeORLateDate(day,DateFormat.COMMON_DATE_FORMAT));

    }

}
